/**
 * Hackystat Version 8 Framework
 * Twitter Widget RPC Interface
 */
package org.hackystat.ui.telemetryviewer.client.common;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.RemoteService;

/**
 * Remote procedure call interface for communicating with the Twitter server. 
 * 
 * @author David J. Nickles
 */
public interface RPCRemoteService extends RemoteService {

  /**
   * This method yields a name and general description for each of the available charts.
   * @param session the host and user attributes.
   * @return BasicConveyor carrying the chart names and descriptions.
   */
  public BasicConveyor getCharts(Session session);
  
  /**
   * Return a detailed description of the chart definition.
   * @param session the host and user attributes.
   * @param chart the name of the requested chart.
   * @return String Description of the requested sensor data.
   */
  public BasicConveyor getChartDefinition(Session session, String chart);
 
  /**
   * Return the telemetry data set for a chart service.
   * @param session the session attributes.
   * @param chart the name of the requested chart.
   * @param params the list of chart parameters.
   * @param start XML formatted timestamp for beginning of data interval.
   * @param end XML formatted timestamp for end of data interval.
   * @return DatasetConveyor the requested telemetry data.
   */
  public DatasetConveyor getChartData(Session session, String chart, String params, 
    String start, String end);
    
  /**
   * This method retrieves the host uris for the Sensorbase and Telemetry services from the
   * Telemetry Viewer properties file.
   * 
   * @return BasicConveyor carrying the host uris for the Sensorbase and Telemetry services from
   * the Telemetry Viewer properties file.
   */
  public BasicConveyor getHosts(); 

  /**
   * Returns true if the user and password is registered as a user with this host.
   * @param session the host and user attributes.
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean isRegistered(Session session);

  /**
   * Registers the user with this host.
   * 
   * @param host the URI for the SensorBase
   * @param user user to authentication
   * @return Boolean indicating if the user and password are valid in the sensorbase
   */
  public Boolean registerUser(String host, String user);

  /**
   * Returns true if the passed host is a Telemetry Analysis service host.
   * 
   * @param host the URI for the Telemetry service.
   * @return Boolean indicating if the host is a valid Telemetry Analysis service.
   */
  public Boolean isTelemetryHost(String host);

  /**
   * Returns true if the passed host is a DPD Analysis service host.
   * 
   * @param host the URI for the DPD service.
   * @return Boolean indicating if the host is a valid DPD Analysis service.
   */
  public Boolean isDPDHost(String host);

  /**
   * Returns true if the passed host is a SensorBase service host.
   * 
   * @param host the URI for the SensorBase.
   * @return Boolean indicating if the host is a valid SensorBase service.
   */
  public Boolean isSensorBaseHost(String host);
  
  /**
   * Returns the attributes set in the Manifest file.
   * 
   * @return BasicConveyor containing a map of the attribute values from the Manifest file.
   */
  public BasicConveyor getManifest(); 
  
  /**
   * Return a formatted description of the requested sensor data on the specified interval.
   * @param session the host and user attributes.
   * @param year of interval
   * @param month of interval
   * @return Boolean array of days with data
   * 
   * @gwt.typeArgs <java.lang.Boolean>
   */
  public ArrayList getOverview(Session session, int year, int month);

  /**
   * Returns the index of all Projects from this server for this user.
   * @param session host and user information.
   * @return Returns the index of all Projects from this server for this user.
   */
  public ProjectConveyor getProjects(Session session);

  /**
   * Logs the message from the javascript client.
   * 
   * @param text message to log.
   */
  public void logClient(String text);
}
